/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package semant.second_pass;

import semant.Env;
import symbol.ClassInfo;
import symbol.MethodInfo;
import symbol.Symbol;
import syntaxtree.MainClass;
import syntaxtree.VisitorAdapter;

/**
 *
 * @author Thiago
 */
class MainClassHandler extends VisitorAdapter{

        private Env env;

    private MainClassHandler(Env e)
    {
        super();

        env = e;
    }

    static void secondPass(Env e, MainClass m)
    {
        MainClassHandler h = new MainClassHandler(e);
        m.accept(h);
    }

    public void visit(MainClass node)
    {
        ClassInfo classe = env.classes.get(Symbol.symbol(node.className.s));
        MethodInfo met = classe.methods.get(Symbol.symbol("main"));
        StatementHandler.secondPass(env,classe,met,node.s);
    }

    

}
